home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / make / icmake-6.000 / icmake-6 / icmake / exec / funascin.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-08  |  737 b   |  33 lines

  1. /*
  2. \fucref{fun\_ascii\_str}{void fun\_ascii\_str ()}
  3.     {}
  4.     {}
  5.     {}
  6.     {}
  7.     {funascin.c}
  8.     {
  9.  
  10.         This function is called when a call to the built-in function {\em
  11.         ascii} is to be processed. This function represents the opcode {\em
  12.         op\_ascii\_int}: a string is converted to an int.
  13.  
  14.         If the last pushed value is a string, then the return register
  15.         is set to the integer (ASCII number) representation of the first
  16.         character in the string.
  17.  
  18.     }
  19. */
  20.  
  21. #include "icm-exec.h"
  22.  
  23. void fun_ascii_str ()
  24. {
  25.     char
  26.         buf [2];
  27.  
  28.     buf [1] = '\0';
  29.     buf [0] = (char) stack [sp].vu.intval;
  30.     reg = newvar (e_str);
  31.     reg.vu.i->ls.str = xstrdup (buf);
  32. }
  33.